<?php


namespace app\service\model;


class OrderModel extends BaseModel
{

    protected $table = 'order';

    /**
     * 订单商品
     * @return \think\model\relation\HasMany
     */
    public function orderGoods(): \think\model\relation\HasMany
    {
        return $this->hasMany(OrderGoodsModel::class, 'order_id', 'id');
    }

    /**
     * 关联用户
     * @return \think\model\relation\BelongsTo
     */
    public function member(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(MemberModel::class, 'member_id', 'id');
    }
}